package com.jiankang.askhealth.util;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public class GsonUtil {
    
    public static String toJson(Object o) {
        Gson g = new GsonBuilder()
                .setDateFormat("yyyy-MM-dd")
                .create();
        return g.toJson(o);
    }
    
    public static String toJson(Object o, String dateFormat) {
        Gson g = new GsonBuilder()
                .setDateFormat(dateFormat)
                .create();
        return g.toJson(o);
    }
    
}
